/**
 * Copyright (c) 2016-2020 https://github.com/zhaohuatai
 *
 * contact z_huatai@qq.com
 *  
 */
package org.zfes.snowier.cloud.zbss.tts.config;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
public class AppCtxUtil  implements ApplicationContextAware {
	
	
	public static ApplicationContext cfg; 
	
	private static String appKey;
	
	
	private static TssConfig tssConfig;

	public static ApplicationContext cfg() {
		return cfg;
	}


	public static void setAppContext(ApplicationContext appContext) {
		AppCtxUtil.cfg = appContext;
	}


	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		AppCtxUtil.cfg = applicationContext;
		tssConfig=applicationContext.getBean(TssConfig.class);
	}


	public static String getAppKey() {
		return appKey;
	}


	public static void setAppKey(String appKey) {
		AppCtxUtil.appKey = appKey;
	}
	
	
	public static String getAudioUploadPath() {
		return tssConfig.getAudioUploadPath();
	}

	public static String getAudioSavePath() {
		return tssConfig.getAudioSavePath();
	}

	public static String getIatApiKey() {
		return tssConfig.getIatApiKey();
	}

	public static String getTtsApiKey() {
		return tssConfig.getTtsApiKey();
	}

	public static String getAppid() {
		return tssConfig.getAppid();
	}

	

}
